package com.anysoft.utils;

import android.text.TextUtils;

/**
 * Created by lty on 2018/3/22.
 */

public class FileUtils {
    /***
     * 获取文件类型 带有?
     *
     * @param filePath
     * @return
     */
    public static String getFileType(String filePath) {
        String str = "";

        if (TextUtils.isEmpty(filePath)) {
            return str;
        }
        int i = filePath.lastIndexOf('.');
        if (i <= -1) {
            return str;
        }
        int j = filePath.lastIndexOf('?');

        str = filePath.substring(i + 1,j);
        return str;
    }
}
